#-*-conding:utf-8-*-

"""

 Created by feiwo at 2018/7/31
 
"""
from app.models.Base import Base
from sqlalchemy import Column, String, Integer, Text, SmallInteger, ForeignKey
from sqlalchemy.orm import relationship

__author__ = 'feiwo'


class Article(Base):

    __tablename__ = 'article'

    cate = relationship('Category')
    cateId = Column(Integer, ForeignKey('cate.id'), nullable=False, name='cate_id')
    content = relationship('Content')
    contentId = Column(Integer, ForeignKey('content.id'), nullable=False, name='content_id')
    title = Column(String(255), nullable=False)
    intro = Column(Text())
    seoKeys = Column(String(255), name='seo_keys')
    url = Column(String(255))
    viewCount = Column(SmallInteger(), nullable=False, default=0, name='view_count')
